package edzest.basic;

public class J07_CalendarV1 {

	public static void main(String[] args) {
		// 2005년 1월 달력 출력
		final String TITLE = "\t\tJanuary 2005";
		final String HDRLINE = "--------------------------------------------";
		final String HDRDAYS = "Sun\tMon\tThu\tWed\tThu\tFri\tSat";
		
		System.out.println(TITLE);
		System.out.println(HDRLINE);
		System.out.println(HDRDAYS);
		
		for(int i = 1; i <= 31; i++){
			if( i % 7 == 0 )
				System.out.println( i );
			else
				System.out.print(i + "\t");
		}
		System.out.println();
		
		int skipday = 6;   // 달력 공백 수
		// 달력 출력 v2 (공백포함)
		for(int i = 1; i <= 31+6; i++, --skipday){
			if( skipday >= 1 ){
				System.out.print( " " + "\t" );
			}else if( i % 7 == 0 )
				System.out.println( (i-6) + "" );
			else
				System.out.print( (i-6) + "\t");
		}
				
	}

}
